package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ShopHomeMapper;
import com.ruoyi.system.domain.ShopHome;
import com.ruoyi.system.service.IShopHomeService;

/**
 * 首页轮播图数据Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-20
 */
@Service
public class ShopHomeServiceImpl implements IShopHomeService 
{
    @Autowired
    private ShopHomeMapper shopHomeMapper;

    /**
     * 查询首页轮播图数据
     * 
     * @param id 首页轮播图数据主键
     * @return 首页轮播图数据
     */
    @Override
    public ShopHome selectShopHomeById(Long id)
    {
        return shopHomeMapper.selectShopHomeById(id);
    }

    /**
     * 查询首页轮播图数据列表
     * 
     * @param shopHome 首页轮播图数据
     * @return 首页轮播图数据
     */
    @Override
    public List<ShopHome> selectShopHomeList(ShopHome shopHome)
    {
        return shopHomeMapper.selectShopHomeList(shopHome);
    }

    /**
     * 新增首页轮播图数据
     * 
     * @param shopHome 首页轮播图数据
     * @return 结果
     */
    @Override
    public int insertShopHome(ShopHome shopHome)
    {
        shopHome.setCreateTime(DateUtils.getNowDate());
        return shopHomeMapper.insertShopHome(shopHome);
    }

    /**
     * 修改首页轮播图数据
     * 
     * @param shopHome 首页轮播图数据
     * @return 结果
     */
    @Override
    public int updateShopHome(ShopHome shopHome)
    {
        shopHome.setUpdateTime(DateUtils.getNowDate());
        return shopHomeMapper.updateShopHome(shopHome);
    }

    /**
     * 批量删除首页轮播图数据
     * 
     * @param ids 需要删除的首页轮播图数据主键
     * @return 结果
     */
    @Override
    public int deleteShopHomeByIds(Long[] ids)
    {
        return shopHomeMapper.deleteShopHomeByIds(ids);
    }

    /**
     * 删除首页轮播图数据信息
     * 
     * @param id 首页轮播图数据主键
     * @return 结果
     */
    @Override
    public int deleteShopHomeById(Long id)
    {
        return shopHomeMapper.deleteShopHomeById(id);
    }
}
